﻿#ifndef DATAFRAME_H
#define DATAFRAME_H

#include "baseframe.h"

namespace IGBTProtocol
{
    class IGBTPROTOCOL_EXPORT DataFrame : public BaseFrame
    {
        public:
            DataFrame();
            ~DataFrame();

        protected:
            DataChannelType _dataChannel;
            DataSourceType _dataSource;

            unsigned int _dataByteSum;
            unsigned char* _data;

        public:
            DataChannelType dataChannel() const { return _dataChannel; }
            DataSourceType dataSource() const { return _dataSource; }
            unsigned int dataByteSum() const { return _dataByteSum; }
            const unsigned char* data() const { return _data; }
            unsigned short channelSampleNum(unsigned char channelNum, unsigned char bytesPerSample = 2) const;
            virtual bool depack(QByteArray* buff);
    };
}

#endif // DATAFRAME_H
